home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: cs.mu.OZ.AU!bounce-back
- From: John Max Skaller <maxtal@suphys.physics.su.oz.au>
- Subject: typeinfo
- Message-ID: <310B7660.4116@suphys.physics.su.oz.au>
- Originator: fjh@munta.cs.mu.OZ.AU
- Sender: news@cs.mu.OZ.AU (CS-Usenet)
- Organization: MAXTAL
- X-Original-Date: Sun, 28 Jan 1996 23: 13:04 +1000
- Date: Mon, 29 Jan 1996 00:05:04 GMT
- Approved: fjh@cs.mu.oz.au
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBFAgUBMQwPbeEDnX0m9pzZAQFDJAGAhWeXSz6cXyPrIVvgAsGdVOKvrSCE6VWY
- Hwh+tIkeg9nycMDBwTyS8nK2OvKdgZVb
- =7XmX
- X-Mailer: Mozilla 2.0b6a (WinNT; I)
-
- > class beatha{public:virtual ~beatha(){};}
- > class duine:public beatha{};
- > class gael: public duine {};
- >
- > beatha *pd=new gael;
- > if(typeid(pd)==typeid(duine)
- > { cout<<"duine";
- > }
- > ...
- > does "duine" get printed here or not?
-
- No. pd denotes an object of exact type "gael".
- This is not the same type as "duine".
- [Note "beatha" is polymorphic]
-
- --
- John Max Skaller voice: 61-2-566-2189
- 81 Glebe Point Rd fax: 61-2-660-0850
- GLEBE NSW 2037 web: http://www.maxtal.com.au/~skaller/
- AUSTRALIA email: skaller@maxtal.com.au
- ---
- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
- Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
- is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
-